/** @type {import('next').NextConfig} */
const nextConfig = {
  async redirects() {
    return [
      // 首页重定向
      {
        source: "/",
        destination: "/home",
        permanent: true,
      },
      {
        source: "/ipdv2",
        destination: "/ipdv2/projects",
        permanent: true,
      },
      // 系统组件类一级目录重定向
      {
        source: "/ipdv2/projects",
        destination: "/ipdv2/projects/list",
        permanent: true,
      },
      {
        source: "/ipdv2/tasks",
        destination: "/ipdv2/tasks/todo",
        permanent: true,
      },
      {
        source: "/ipdv2/digital-twin",
        destination: "/ipdv2/digital-twin/graph",
        permanent: true,
      },
      {
        source: "/ipdv2/cloud-docs",
        destination: "/ipdv2/cloud-docs/standards",
        permanent: true,
      },
      {
        source: "/ipdv2/settings",
        destination: "/ipdv2/settings/access",
        permanent: true,
      },
      {
        source: "/ipdv2/about-us",
        destination: "/ipdv2/about-us/dev-progress",
        permanent: true,
      },
      // 工具类一级目录重定向
      {
        source: "/ipdv2/tools/relay-simulation",
        destination: "/ipdv2/tools/relay-simulation/list",
        permanent: true,
      },
      {
        source: "/ipdv2/tools/traffic-forcast",
        destination: "/ipdv2/tools/traffic-forcast/list",
        permanent: true,
      },
      {
        source: "/ipdv2/tools/pannel-assignment",
        destination: "/ipdv2/tools/pannel-assignment/list",
        permanent: true,
      },
    ];
  },
};

module.exports = nextConfig;
